package com.gexiaobao.pigeon.ui.dialog

import android.annotation.SuppressLint
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import androidx.appcompat.widget.AppCompatEditText
import androidx.appcompat.widget.AppCompatTextView
import com.gexiaobao.pigeon.R

/**
 * @author: hxw
 * @date  : 2022/12/8
 * @desc  :
 */
class RxDialogModifyPsw(context: Context?) : RxDialog(context!!) {

    private lateinit var sureView: AppCompatTextView
    private lateinit var tvDialogCancel: AppCompatTextView
    lateinit var forgetVerifyCodeSend: AppCompatTextView
    lateinit var forgetPhone: AppCompatEditText
    lateinit var forgetCode: AppCompatEditText
    lateinit var forgetPwd: AppCompatEditText
    lateinit var forgetRepeatPwd: AppCompatEditText

    init {
        initView()
    }

    @SuppressLint("MissingInflatedId")
    private fun initView() {
        val dialogView = LayoutInflater.from(context).inflate(R.layout.dialog_modify_psw, null)
        sureView = dialogView.findViewById(R.id.tv_dialog_sure)
        tvDialogCancel = dialogView.findViewById(R.id.tv_dialog_cancel)
        forgetVerifyCodeSend = dialogView.findViewById(R.id.forget_verify_code_send)
        forgetPhone = dialogView.findViewById(R.id.forget_phone)
        forgetCode = dialogView.findViewById(R.id.forget_code)
        forgetPwd = dialogView.findViewById(R.id.forget_pwd)
        forgetRepeatPwd = dialogView.findViewById(R.id.forget_repeat_pwd)
        tvDialogCancel.setOnClickListener {
            dismiss()
        }
        setContentView(dialogView)
    }

    fun setSureListener(listener: View.OnClickListener?) {
        sureView.setOnClickListener(listener)
    }

    fun setSendCodeListener(listener: View.OnClickListener?) {
        forgetVerifyCodeSend.setOnClickListener(listener)
    }

}